#! /usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) JoinQuant Development Team
# Author: Huayong Kuang <kuanghuayong@joinquant.com>

from retrying import retry


TableNoExists = type('TableNoExists', (Exception,), {})


@retry(stop_max_attempt_number=2,
       retry_on_exception=lambda e: isinstance(e, TableNoExists))
def foo():
    print("-"*100)
    raise TableNoExists("test")


foo()
